package com.example.myapplication.fixation;
import android.content.Context;


/****
 *
 *
 *创建人：xuiqng
 *创建时间：2021年10月15日11:25:37
 * 类说明：
 *
 *
 *
 */


public class FloatMenuGiftbag {
    private GiftBagFloatView mGiftBagFloatView ;
    private boolean register=false;
    private FloatMenuGiftbag(){

    }

    private volatile static FloatMenuGiftbag mFloatMenuGiftbag = null ;

    public  static FloatMenuGiftbag getInstance()
    {
        if(mFloatMenuGiftbag == null)
        {
            synchronized (FloatMenuGiftbag.class) {
                if(mFloatMenuGiftbag == null)
                {
                    mFloatMenuGiftbag = new FloatMenuGiftbag();
                }
            }
        }
        return mFloatMenuGiftbag ;
    }

    public  void showFloatMenu(final Context context) {
            if(mGiftBagFloatView==null){
                mGiftBagFloatView=new GiftBagFloatView(context,register);
            }
            mGiftBagFloatView.setIsRegister(register);


    }

    public void hideFloatMenu(){

            if(mGiftBagFloatView!=null){
                mGiftBagFloatView.hideFloatView();
                mGiftBagFloatView=null;
            }


    }

    public void setRegister(boolean register){
        this.register=register;
    }

    public void destroyFloatView(){
        if(mGiftBagFloatView!=null){
            mGiftBagFloatView.hideFloatView();
            mGiftBagFloatView=null;
        }
    }

}
